package com.koocloud.electroplatemanage.mapper;

import com.koocloud.electroplatemanage.pojo.mainpojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MainProductionMapper {
    //通过pk查询生产计划实绩表
    public OrderResource selectOrderResourceByPk(int id);
    //通过pk查询生产计划实绩表
    List<OrderResource> selectOrderResourceByworkOrderNumber(@Param("workOrderNumber") String workOrderNumber ,@Param("routePosition") String routePosition);
    List<OrderResource> selectOrderResourceAllData(String beginTime, String endTime, String idOrName);
    //新增生产计划实绩表
    public int insertOrderResource(OrderResource orderResource);
    //修改生产计划实绩表
    public int updateOrderResource(OrderResource orderResource);
    //通过工单号查询生产实绩表列表
    List<OrderResource> selectOrderResourceListByWON(@Param("workOrderNumber") String workOrderNumber);

    //通过pk查询工单拆分表
    public OrderSplit selectOrderSplitByPk(int id);
    //新增工单拆分表
    public int insertOrderSplit(OrderSplit orderSplit);
    //修改工单拆分表
    public int updateOrderSplit(OrderSplit orderSplit);

    //通过pk查询路径表
    public Route selectRouteByPk(int id);
    //通过pk查询路径表
    public Route selectRouteOne();
    //新增生产路径表
    public int insertRoute(Route route);
    //修改生产路径表
    public int updateRoute(Route route);

    //通过pk查询生产在工表
    public WIP selectWIPByPk(String workOrderNumber);
    //通过当前位置查询生产在工表所有记录
    public List<WIP> selectAllWIPByLocation(String currentLocation);
    //新增生产在工表
    public int insertWIP(WIP wip);
    //修改生产在工表
    public int updateWIP(WIP wip);
    //删除生产在工表
    public int deleteWIP(String workOrderNumber);
    //修改在工流程位置
    int updateLocation(String userId, String location);


    //通过pk查询生产工单号表
    public WorkOrder selectWorkOrderByPk(String workOrderNumber);
    //新增生产工单号表
    public int insertWorkOrder(WorkOrder workOrder);
    //修改生产工单号表
    public int updateWorkOrder(WorkOrder workOrder);
    //分页查询所有数据
    List<WIP> selectWIPAllData(WIP wip);


    //根据id查找路由
    String selectRouteById(String routeId);
}
